package com.byb.server.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.springframework.data.elasticsearch.annotations.Document;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Objects;

/**
 * 投保须知
 */
@ApiModel(description = "投保须知")
@Entity
@Table(name = "cover_guide")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
@Document(indexName = "coverguide")
public class CoverGuide implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 被保人年龄
     */
    @ApiModelProperty(value = "被保人年龄")
    @Column(name = "insured_age")
    private String insuredAge;

    /**
     * 被保人年龄描述
     */
    @ApiModelProperty(value = "被保人年龄描述")
    @Column(name = "insured_age_abstract")
    private String insuredAgeAbstract;

    /**
     * 健康要求
     */
    @ApiModelProperty(value = "健康要求")
    @Column(name = "health_requirement")
    private String healthRequirement;

    /**
     * 职业要求
     */
    @ApiModelProperty(value = "职业要求")
    @Column(name = "professional_requirements")
    private String professionalRequirements;

    @OneToOne
    @JoinColumn(unique = true)
    private Product product;

    // jhipster-needle-entity-add-field - Jhipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getInsuredAge() {
        return insuredAge;
    }

    public CoverGuide insuredAge(String insuredAge) {
        this.insuredAge = insuredAge;
        return this;
    }

    public void setInsuredAge(String insuredAge) {
        this.insuredAge = insuredAge;
    }

    public String getInsuredAgeAbstract() {
        return insuredAgeAbstract;
    }

    public CoverGuide insuredAgeAbstract(String insuredAgeAbstract) {
        this.insuredAgeAbstract = insuredAgeAbstract;
        return this;
    }

    public void setInsuredAgeAbstract(String insuredAgeAbstract) {
        this.insuredAgeAbstract = insuredAgeAbstract;
    }

    public String getHealthRequirement() {
        return healthRequirement;
    }

    public CoverGuide healthRequirement(String healthRequirement) {
        this.healthRequirement = healthRequirement;
        return this;
    }

    public void setHealthRequirement(String healthRequirement) {
        this.healthRequirement = healthRequirement;
    }

    public String getProfessionalRequirements() {
        return professionalRequirements;
    }

    public CoverGuide professionalRequirements(String professionalRequirements) {
        this.professionalRequirements = professionalRequirements;
        return this;
    }

    public void setProfessionalRequirements(String professionalRequirements) {
        this.professionalRequirements = professionalRequirements;
    }

    public Product getProduct() {
        return product;
    }

    public CoverGuide product(Product product) {
        this.product = product;
        return this;
    }

    public void setProduct(Product product) {
        this.product = product;
    }
    // jhipster-needle-entity-add-getters-setters - Jhipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CoverGuide coverGuide = (CoverGuide) o;
        if (coverGuide.getId() == null || getId() == null) {
            return false;
        }
        return Objects.equals(getId(), coverGuide.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(getId());
    }

    @Override
    public String toString() {
        return "CoverGuide{" +
            "id=" + getId() +
            ", insuredAge='" + getInsuredAge() + "'" +
            ", insuredAgeAbstract='" + getInsuredAgeAbstract() + "'" +
            ", healthRequirement='" + getHealthRequirement() + "'" +
            ", professionalRequirements='" + getProfessionalRequirements() + "'" +
            "}";
    }
}
